<template>
  <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="jump"
      :page-sizes="[5,10, 15, 20]"
      :page-size="100"
      layout="total, sizes, prev, pager, next, jumper"
      :total="total"
    >
    </el-pagination>
  </div>
</template>

<script>
import mitt from "@/utils/mitt";
export default {
  props: {
    list: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      total: 0,
      jump: 1,
      currentPage: [],
    };
  },
  watch: {
    list(newvalue, oldvalue) {
      console.log(newvalue, "接受的值22222222");
      this.total = newvalue.total;
      this.currentPage = newvalue.usermessages;
      // this.menuList = newvalue;
      // console.log(this.menuList, "列表");
    },
  },
  methods: {
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`);
      mitt.emit("currt", val);
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      mitt.emit("page", val);
    },
  },
};
</script>

<style>
</style>